﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogAnProject
{
    public class Calculator
    {
        private int sum = 0;  //calculator objesi yaratildigi anda fieldlar  da olusturulurdu unuttunmu :)

        public void Add(int number)
        {
            sum += number;   //sum calculater objesi sonlanmadigi surece yasayacak
        }
        public int Sum()
        {
            int temp = sum;         //sum =0
            sum = 0;
            return temp;
        }
    }
}
